package main

import (
	"fmt"
	"sync"
	"time"
)

var wg sync.WaitGroup

func main() {
	fmt.Println("vim-go")
	wg.Add(1)
	openTimer()
	wg.Wait()
}

var timerCnt uint64 = 0

func openTimer() {

	timerTick := time.NewTicker(time.Second)
	go func() {
		for range timerTick.C {
			fmt.Printf("[tick] timenow: [%v]timerCnt: [%v]\n", time.Now(), timerCnt)
			timerCnt++
			if timerCnt > 3 {
				wg.Done()
			}
		}
	}()
}
